package com.banmoon.memento;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Originator {

    private int hp;

    private int atk;

    private int def;

    public Memento createMemento() {
        return new Memento(hp, atk, def);
    }

    public void showCurrentStatus(){
        System.out.println(StrUtil.format("血量：{}，攻击力：{}，防御力：{}", hp, atk, def));
    }

    public void restoreMemento(Memento m) {
        this.setHp(m.getHp());
        this.setAtk(m.getAtk());
        this.setDef(m.getDef());
    }
}
